<?php
/**
 * sdPHP
 * @author     码农<8044023@qq.com>
 * @copyright  sdPHP
 * @license    https://gitee.com/cq8044023/sdphp
 */
namespace sdphp\lib;
class Config{
    public static $_config;
    /**
     * 加载配置信息
     *   */
    public static function loadConfig(){
        //加载用户任务配置
        foreach(glob(CONFIG_PATH."*.php") as $file){ 
            $arr=explode(DS, $file);
            $config_name=str_replace(EXT, "", end($arr));
            self::$_config[$config_name]=include $file;
        }
    }
    /**
     * 获取配置文件
     * @param unknown $model    模块
     *   */
    public static function getConfig($model="config"){ 
        return self::$_config[$model];  
    }
    /**
     * 设置配置项
     * @param unknown $key
     * @param unknown $val  */
    public static function setConfig($key,$val){ 
        self::$_config[$key]=$val;
    }
}